package com.antdesignbackend.backend.controller;

import com.antdesignbackend.backend.animalNumber.entity.AnimalNumber;
import com.antdesignbackend.backend.animalNumber.service.AnimalNumberService;
import com.antdesignbackend.backend.common.returnResult.ReturnVO;
import com.antdesignbackend.backend.common.web.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/animalnumber")
public class AnimalnumberController extends BaseController {

    @Autowired
    AnimalNumberService animalNumberService;

    @GetMapping("/getBatch")
    @ResponseBody
    public ReturnVO getBatch(){
        ReturnVO returnVO = new ReturnVO();
        QueryWrapper<AnimalNumber> wrapper = new QueryWrapper<>();
        wrapper.eq("eid",getLoginEnterpriseId());
        List<AnimalNumber> list = animalNumberService.list(wrapper);
        returnVO.setData(list);
        return returnVO;
    }
}

